/* ================================================= */
/* === CÀI ĐẶT CHUNG VÀ BIẾN (THIẾT KẾ HOÀN CHỈNH) === */
/* ================================================= */

:root {
    --primary-color: #0070c9; /* Xanh dương Apple */
    --secondary-color: #86868b; 
    --accent-color: #fa5252; /* Màu đỏ cho giá và mua ngay */
    --text-color-dark: #1d1d1f;
    --text-color-light: #6e6e73;
    --bg-color-light: #f5f5f7;
    --card-bg: #fff;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08); 
    --shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.15); 
}

/* Cài đặt lại CSS cơ bản */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    line-height: 1.5;
    color: var(--text-color-dark);
    background-color: var(--bg-color-light);
}

/* --- 1. HEADER & NAVIGATION --- */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background-color: var(--card-bg);
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.1); 
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Cải tiến Logo */
.logo-container .logo {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-color-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.3s;
}

.logo-container .logo:hover {
    color: var(--primary-color);
}

.logo-container .logo i {
    font-size: 1.2em;
    margin-right: 8px;
    color: #a2a2a7; /* Màu xám bạc cho icon Apple */
    transition: color 0.3s;
}

.logo-container .logo:hover i {
    color: var(--primary-color);
}

.main-nav a {
    text-decoration: none;
    color: var(--text-color-light);
    margin: 0 18px;
    padding: 8px 0;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--primary-color);
}

/* Nút Quay lại Trang chủ (Elegant Button) */
.elegant-button {
    text-decoration: none;
    font-weight: 500;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    background-color: transparent;
    border-radius: 8px;
    color: var(--text-color-light);
    transition: all 0.3s ease-in-out;
    display: flex;
    align-items: center;
    gap: 8px;
}

.elegant-button:hover {
    background-color: #f1f1f1;
    color: var(--primary-color);
    border-color: var(--primary-color);
}


/* --- 2. HERO BANNER & FOOTER (Giữ nguyên) --- */
.hero-banner {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); 
    height: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    position: relative;
}

.banner-content {
    background-color: rgba(0, 0, 0, 0.5); 
    padding: 40px 60px;
    border-radius: 10px;
}

.banner-content h1 {
    font-size: 3.5em;
    font-weight: 700;
    margin-bottom: 15px;
}

.btn-shop-now {
    background-color: var(--card-bg); 
    color: var(--text-color-dark);
    padding: 10px 25px;
    border-radius: 999px; 
    font-weight: 600;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
}
.btn-shop-now:hover {
    background-color: #e0e0e0;
}

footer {
    text-align: center;
    padding: 25px;
    background-color: var(--text-color-dark);
    color: #e0e0e0;
    margin-top: 40px;
}

/* --- 3. PRODUCT LISTING (Giữ nguyên) --- */
.product-listing {
    padding: 60px 5%;
    text-align: center;
}

.product-listing h2 {
    font-size: 2em;
    font-weight: 600;
    margin-bottom: 40px;
    color: var(--text-color-dark);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    border-radius: 12px;
    overflow: hidden; 
    box-shadow: var(--shadow-light);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    background-color: var(--card-bg);
    text-decoration: none;
    color: inherit;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    background-color: var(--bg-color-light); 
    padding: 20px;
    position: relative;
    border-bottom: 1px solid #eee;
}

.product-image img {
    height: 150px;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: bold;
    color: white;
}

.badge.new { background-color: var(--primary-color); }
.badge.sale { background-color: var(--accent-color); }

.product-card h3 {
    padding: 15px 15px 0;
    font-size: 1.2em;
    font-weight: 600;
}

.price {
    padding: 0 15px;
    font-size: 1.3em;
    color: var(--text-color-dark);
    font-weight: 700;
}

.btn-add-cart {
    padding: 10px 20px;
    border-radius: 999px; 
    margin: 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
}


/* ================================================= */
/* === TRANG CHI TIẾT SẢN PHẨM (product-detail.html) === */
/* ================================================= */

.main-content-wrapper {
    max-width: 1280px;
    margin: 20px auto 40px;
    padding: 0 20px;
}

.product-detail-container {
    display: flex;
    gap: 40px;
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow-light);
    margin-bottom: 30px;
}

/* 1. Cột Hình ảnh (Cải tiến) */
.product-images {
    flex: 1; 
    max-width: 50%;
    background-color: var(--bg-color-light);
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    overflow: hidden; 
    position: relative;
    cursor: zoom-in;
}

#main-product-image {
    max-height: 450px; 
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto 15px;
    box-shadow: none;
    border-radius: 0;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Hiệu ứng mượt mà */
}

.product-images:hover #main-product-image {
    transform: scale(1.05); /* Phóng to nhẹ khi hover */
}

.thumbnail-images {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.thumbnail {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    border: 2px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.thumbnail.active {
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 112, 201, 0.3);
    opacity: 1;
}

/* 2. Cột Thông tin */
.product-info-column {
    flex: 1;
    padding: 0 20px;
}

.product-title {
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 15px;
}

.price-section {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 25px;
}

.current-price {
    font-size: 2em;
    color: var(--accent-color);
    font-weight: 700;
    margin-right: 15px;
}

.old-price {
    text-decoration: line-through;
    color: var(--secondary-color);
    font-size: 1.1em;
}

.discount-badge {
    background-color: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    margin-left: 10px;
}

/* Biến thể và số lượng */
.product-variants {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.variant-label {
    font-weight: 600;
    color: var(--text-color-dark);
    margin-bottom: 10px;
    font-size: 1.1em;
}

.color-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ccc;
    transition: transform 0.2s, border-color 0.2s;
}

.color-swatch.active {
    border: 3px solid var(--primary-color);
    transform: scale(1.1);
}

.storage-options {
    display: flex;
    gap: 10px;
}

.storage-btn {
    padding: 10px 20px;
    border: 1px solid #ccc;
    background-color: var(--bg-color-light);
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.storage-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.quantity-input {
    width: 80px;
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 5px;
}


/* --- NÚT BẤM (ADD TO CART & BUY NOW) --- */
.action-buttons-group {
    display: flex;
    gap: 15px;
    margin-top: 35px;
}

.btn-add-to-cart, .btn-buy-now {
    padding: 16px 30px;
    border: none;
    border-radius: 999px; 
    cursor: pointer;
    font-size: 1.15em;
    font-weight: 600;
    transition: all 0.2s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white;
}

.btn-add-to-cart {
    flex: 1.5;
    background-color: var(--primary-color); 
    box-shadow: 0 4px 15px rgba(0, 112, 201, 0.4); 
}

.btn-add-to-cart:hover {
    background-color: #005bb5; 
    box-shadow: 0 8px 20px rgba(0, 112, 201, 0.6); 
}

.btn-add-to-cart:active {
    transform: translateY(1px); 
    box-shadow: 0 2px 5px rgba(0, 112, 201, 0.4);
}

.btn-buy-now {
    flex: 1;
    background-color: var(--accent-color); 
    box-shadow: 0 4px 15px rgba(250, 82, 82, 0.4); 
}

.btn-buy-now:hover {
    background-color: #e54c4c;
    box-shadow: 0 8px 20px rgba(250, 82, 82, 0.6); 
}

.btn-buy-now:active {
    transform: translateY(1px); 
    box-shadow: 0 2px 5px rgba(250, 82, 82, 0.4);
}

/* --- 3. Phần Thông số & Mô tả (Bố cục 2 cột nằm dưới) --- */
.spec-detail-section {
    display: flex;
    gap: 30px;
    margin-top: 30px;
    padding: 0 20px;
    max-width: 1280px;
    margin: 30px auto 40px;
}

.specs-box, .description-box {
    flex: 1;
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 30px;
    box-shadow: var(--shadow-light);
}

.box-title {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 2px solid var(--bg-color-light);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.spec-list {
    list-style: none;
    padding: 0;
}

.spec-list li {
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
    color: var(--text-color-dark);
    font-size: 1.05em;
}

.spec-list li:last-child {
    border-bottom: none;
}

.spec-list li i {
    color: var(--secondary-color);
    margin-right: 10px;
}

.description-box p {
    color: var(--text-color-light);
    line-height: 1.8;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .product-detail-container {
        flex-direction: column;
        padding: 30px;
    }
    .product-images, .product-info-column {
        max-width: 100%;
        padding: 0;
    }
    .action-buttons-group {
        flex-direction: column;
    }
    .spec-detail-section {
        flex-direction: column;
    }
}
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 10px;
    }
    .product-grid {
        grid-template-columns: 1fr;
    }
}